"""
Case Type   : GS_GLOBAL_CONFIG
Case Name   : 删除系统表gs_global_config不存在参数,合理报错
Create At   : 2022/07/22
Owner       : @zou_jialiang050
Description :
    1.删除系统表gs_global_config不存在参数
Expect      :
    1.合理报错
History     :
"""

import os
import unittest
from testcase.utils.CommonSH import CommonSH
from testcase.utils.Logger import Logger


class Confirguration(unittest.TestCase):
    def setUp(self):
        self.logger = Logger()
        self.primary_sh = CommonSH('PrimaryDbUser')

    def test_alter_global_configuration(self):
        self.logger.info(f'-----{os.path.basename(__file__)} start-----')
        step = 'step1:删除系统表gs_global_config不存在参数 expect:合理报错'
        self.logger.info(step)
        drop_configuration = self.primary_sh.execut_db_sql(
            f'''drop global configuration test;''')
        self.logger.info(drop_configuration)
        self.assertIn('ERROR:  Parameter test not exists, please check it',
                      drop_configuration, '执行失败' + step)

    def tearDown(self):
        self.logger.info('----无需清理环境----')
        self.logger.info(f'-----{os.path.basename(__file__)} end-----')
